package mse.eai.jbpm.sendFriendshipRequest;


import org.jboss.logging.Logger;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;

public class PrepareFrienshipRequestNotification implements ActionHandler {
	
	private static final Logger log = Logger
	.getLogger(PrepareFrienshipRequestNotification.class);
	

	@Override
	public void execute(ExecutionContext context) throws Exception {

		System.out.println("-------------- PREPARE NOTIFICATION --------------------");
		
		context.setVariable("subject", "PhaseBook Frienship Request Notification");
		context.setVariable("message", "You have a new friendship request");
		//context.setVariable("requesterId", new Integer((Integer) context.getVariable("requesterId")));
		
		
		// -------------------------------
		log.info("WILL SUSPEND PROCESS TO BE SIGNALED");
		
		log.info("processKey = " + context.getProcessInstance().getKey());
		
		log.info("PLEASE SIGNAL THIS"); 
		// -------------------------------
		

		context.leaveNode();
		
		
	}

}
